﻿package mortal.game.view.signUp.view
{
    import __AS3__.vec.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.common.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.view.signUp.util.*;
    import mortal.mvc.core.*;

    public class EffectLayer extends GSprite
    {
        private var _effectVec:Vector.<SWFPlayer>;

        public function EffectLayer()
        {
            this._effectVec = new Vector.<SWFPlayer>;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            var _loc_2:SWFPlayer = null;
            super.createDisposedChildrenImpl();
            var _loc_1:int = 0;
            while (_loc_1 < SignUpConst.Tag_TotalNum)
            {
                
                _loc_2 = UICompomentPool.getUICompoment(SWFPlayer);
                this._effectVec.push(_loc_2);
                this.pushUIToDisposeVec(_loc_2);
                _loc_1++;
            }
            Dispatcher.addEventListener(EventName.SignUpUpdateTagEffectState, this.onEffectStateUpdate);
            return;
        }// end function

        private function onEffectStateUpdate(event:DataEvent) : void
        {
            var _loc_2:* = event.data.tabIndex as int;
            var _loc_3:* = event.data.isShowEffect as Boolean;
            var _loc_4:* = int(event.data.y);
            var _loc_5:* = this._effectVec[_loc_2];
            if (_loc_3)
            {
                _loc_5.timeRate = 3;
                _loc_5.scaleY = 0.8;
                _loc_5.load("guide_noName.swf", ModelType.NormalSwf, null);
                _loc_5.move(0, _loc_4);
                this.addChild(_loc_5);
            }
            else
            {
                DisplayUtil.removeMe(_loc_5);
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._effectVec.length = 0;
            Dispatcher.removeEventListener(EventName.SignUpUpdateTagEffectState, this.onEffectStateUpdate);
            return;
        }// end function

    }
}
